home *** CD-ROM | disk | FTP | other *** search
- NAME
- make -- maintain program groups
-
- SYNOPSIS
- make [ -fmakefile ] [ options ] [ arguments ]
-
- DESCRIPTION
- Make executes commands in a "makefile" to update one or more
- target files. If no "-f" option is present, "MAKEFILE" is
- used as the makefile.
-
- Make updates a target if it depends on prerequisite files
- that have been modified since the target was last modified,
- or if the target does not exist.
-
- A makefile contains a sequence of entries that specify
- dependencies. The first line of an entry contains a target
- filename, then a colon (:), then a list of space-separated
- prerequisite filenames. All following lines that begin with
- a tab character are commands to be executed to update the
- target. Sharp (#) and newline surround comments.
-
- Thus the following makefile indicates that two object files
- "foo1" and "foo2" depend on respective ".c" files and a
- common file "incl.h", and that "foo.exe" depends on both of
- the object files.
-
- foo1.obj : foo1.c incl.h
- lc1 foo1 -b -c -i\h\ -s
- lc2 foo1 -v
- foo2.obj : foo2.c incl.h
- lc1 foo2 -b -c -i\h\ -s
- lc2 foo2 -v
- foo.exe : foo1.obj foo2.obj
- plink86 ou foo fi crt2s,foo1,foo2 li lib2s
-
- Makefile entries of the form
-
- string1 = string2
-
- are macro definitions. Subsequent appearances of $string1
- will be replaced by string2. All environment strings are
- entered as macros (for example, $PATH). All non-option
- arguments are also entered as macros under the convention
- $1, $2, $#, etc. At least 10 arguments are entered, with
- unspecified arguments entered as null strings. The length
- of a macro definition is limited to 15 characters, and the
- length of its expansion is limited to 255 characters. There
- is a limit of 64 macros.
-
- The combination of backslash (\) and newline is interpreted
- as a continuation line.
-
- Command lines are executed one at a time, either by spawning
- another shell (via system()) or by directly executing the
- program (via exec()). A line is printed when a command is
- executed, unless the first character of the command is '@'.
-
- Commands returning non-zero status (shell commands always
- return zero) cause make to terminate unless the first
- character of the command is '-'.
-
- Entering an Escape character while make is working will
- cause make to terminate before examining the next target.
-
- Other options include:
-
- -i : Ignore error return values from all commands.
-
- -n : Trace and print, but do not execute the commands needed
- to update the targets.
-
- -s : Perform all commands in silent mode -- do not print any
- lines for any commands.
-
- RETURNS
- 1 if some error occurred, otherwise 0.
-
- BUGS
- Macro lengths are not checked very carefully.
- Both the colon in dependency lines and the equal sign in
- macro definitions must be surrounded by spaces.
- Beware of lines which may inadvertently end with backslash.
-
- FUTURES
- Someday make may support two special targets: labels and
- tests with "goto" directives. This is the primary reason
- for not performing topological sorts.
-
- EXAMPLE
-
- #
- # makefile for make
- #
-
- make.obj : make.c
- copy c:\h\stds.h c:\h\stdio.h
- lc1 make -b -ic:\h\ -c
- lc2 make -v
-
- \bin\make.exe : \lib\crt2s.obj \lib\envps.obj make.obj \lib\lib2s.lib
- plink86 ou make f crt2s,envps,make li lib2s
- setsiz make 5
- copy make.exe \bin
- del make.exe
- i lib2s
- setsiz make 5
- copy make.exe \bin
- del make.exe